package cn.e3mall.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
/**
 * 内容管理
 * @author zhouzhixiang
 *
 */
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.e3mall.common.pojo.EasyUIDataGridResult;
import cn.e3mall.common.util.E3Result;
import cn.e3mall.content.service.ContentService;
import cn.e3mall.pojo.TbContent;
@Controller
public class ContentController {

	@Autowired
	private ContentService contentService;
	
	
	@RequestMapping(value="/content/save",method=RequestMethod.POST)
	@ResponseBody 
	public E3Result addContent(TbContent tContent){
		//调用服务保存到数据库
		E3Result  e3Result = contentService.addContent(tContent);
		return e3Result;
	}
	
	@RequestMapping("/content/query/list")
	@ResponseBody
	public EasyUIDataGridResult getContentList(Integer page,Integer rows,Long categoryId){
		EasyUIDataGridResult easyUIDataGridResult = contentService.getContentList(page, rows,categoryId);
		return easyUIDataGridResult;
	}
	
}
